package club.beimeng.educms.controller;


import club.beimeng.commonutils.R;
import club.beimeng.educms.entity.CrmBanner;
import club.beimeng.educms.service.CrmBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 首页banner表 前端控制器
 * </p>
 *
 * @author 小艾同学
 * @since 2021-08-01
 */
@CrossOrigin
@RestController
@RequestMapping("/educms/bannerFrom")
public class BannerFromController {


    @Autowired
    private CrmBannerService bannerService;


//    @Cacheable(key = "'selectIndexList'",value = "banner")
    // 查询所有banner
    @GetMapping("getAllBanner")
    public R getAllBanner(){
        List<CrmBanner> list = bannerService.selectAllBanner();
        return R.ok().data("list",list);
    }
}

